<?php

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/

/** @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(App\Models\Access\User\User::class, function (Faker\Generator $faker) {
    static $password;

    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => $password ?: $password = bcrypt('secret'),
        'remember_token' => str_random(10),
    ];
});
/*等级评分*/
$factory->define(App\Models\Flaw\Level::class, function (Faker\Generator $faker) {
    return [
        'name' => $faker->lastName ,
/*        'name' => $faker->$faker->bank ,*/
        'level' =>1,
        'description' => $faker->text(),
        'min_reward' =>$faker->randomNumber(2),
        'max_reward' =>$faker->randomNumber(2),
        'min_integ' =>  $faker->randomNumber(2),
        'max_integ' =>  $faker->randomNumber(2),
        'term' =>  $faker->randomNumber(2),
    ];
});
/*漏洞表*/
$factory->define(App\Models\Flaw\Vuls::class, function (Faker\Generator $faker) {
    return [
        'title' => $faker->firstName ,
        'description' => $faker->text(),
        'user_id' =>$faker->randomDigitNotNull,
        'app_id' =>$faker->randomDigit,
        'category_id' =>$faker->randomNumber(2),
        'level_id' =>  $faker->randomNumber(2),
        'content' =>  $faker->realText($maxNbChars = 200, $indexSize = 5),
        'reward' =>  $faker->randomNumber(2),
        'credit' =>  $faker->randomNumber(2),
        'status' =>  $faker->randomDigit,
        'is_delete' =>  $faker->randomNumber(2),
        'delete_at' => $faker->dateTime($max = 'now', $timezone = date_default_timezone_get()),
    ];
});